<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/jsp/common/common.jsp" %>
<%
	String groupId = request.getAttribute("groupId") == null?"":request.getAttribute("groupId").toString();
	String domainId = request.getAttribute("domainId") == null?"":request.getAttribute("domainId").toString();
%>
</head>
<body>

<div class="tableMainWarp">
  <div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="search-table">
      <tr>
      	<td width="20%">参与者：</td>
      	<td width="50%">
      		<input type="text" class="table-input" id="takePartName" name="takePartName" value=""/>
      		<input type="hidden" id="takePartId" name="takePartId" value=""/>
   		</td>
      	<td width="30%">
      		<button class="btn-table" id="searchButton">查询</button>
      	</td>
      </tr>	
    </table>
  </div>
  <div class="tablelist" style="margin-right: 20px;">
    <div class="tabcon" id="middleCon"></div>
    <div id="paginationDiv"  class="page clearfix"></div>
  </div>
</div>


<script type="text/javascript">

$(document).ready(function(){
	
	var bodyHt=document.documentElement.clientHeight;
	var tableDivHeight = bodyHt-77;	
	$('#middleCon').height(tableDivHeight);
	
	//getPageData();

	initTable();
	
	blindPageElement();
	
});

function blindPageElement(){

	//绑定查询按钮
	$('#searchButton').on('click',function(){
		$('#middleCon').tablegrid('reload',{
			takePartId : $('#takePartId').val()
		});
	});
	
	var url = '<%=basePath%>/biz/ou/employee/getEmployeeIdentityForComplete.do?domainId=<%=domainId%>';
	$("#takePartName").autocomplete({
		url : url,
		contentFormatter : function( text, data ){
			return data.empName + ' '+data.empSerialNumber+' ' + data.orgName + ' ' + data.positionName;
		},
		textFormatter : function(data){
 			return data.empName + ' '+ data.empSerialNumber+' ' + data.orgName + ' ' + data.positionName;
		}, 
		postSelect : function(data){
			$('#takePartId').val(data.eiId);
		}
	});	

}

function initTable(){
 	
	var url = "<%=basePath%>/biz/ou/group/getGroupPreviewListData.do?domainId=<%=domainId%>&groupId=<%=groupId%>";
	
	$('#middleCon').tablegrid({
		url: url,
		columns:[	
		         	{field:'id',ischeckbox:true,align:'center',width:4},
		   	        {field:'empName',title:'姓名',width:11},
		   	        {field:'empSerialNumber',title:'员工编号',width:11},
		   	     	{field:'accountName',title:'登陆账户名称',width:13},
		   	     	{field:'positionName',title:'职务名称',width:11},
		   	     	{field:'positionLevel',title:'职务级别',width:11},
		   	        {field:'orgName',title:'部门名称',width:15},
		   	        {field:'orgSerialNumber',title:'部门编号',width:11},
		   	     	{field:'orgLevelName',title:'部门级别',width:13}
			    ],
	    isPagination:false,
	    resizeColumns : true,
	    isFristData:false,
	    tableClass : 'table-form'
	});
}






</script>
</body>
</html>